<template>
  <view style="width: 100%; min-height: 100vh; position: relative;">
    <view style="width: 100%; padding: 0 60upx;">
      <view class="flex justify-between align-center" style="width: 100%; height: 96upx; border-bottom: 2upx solid #F8F8F8;" v-for="(item, index) in set_up_list" :key="index" @click="handleToSetUpContent(index)">
        <view style="font-size: 26upx; color: #333333;">{{item}}</view>
        <image src="/static/icon/icon_more@2x.png" style="width: 30upx; height: 30upx;"></image>
      </view>
    </view>
    <view style="position: absolute; bottom: 128upx; padding: 0 76upx;">
      <view @click="handleLoginOut()" class="flex align-center justify-center"
            style=" width: 596upx; height: 80upx; margin-bottom: 30upx; background-color: #E52718; color: white; font-size: 28upx; border-radius: 40upx;">
        退出登录
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data(){
    return {
      set_up_list: ['意见反馈','修改密码','关于我们'], //设置列表
    }
  },
  methods:{
    /**
     * @name 设置内容跳转
     * @param {Object} index 索引值
     */
    handleToSetUpContent(index){
      console.log(index)
      switch (index) {
		case 0:
      this.$uniNavigateTo({
        url: '/pages/my/setUp/feedBack/feedBack'
      })
		  break;
		case 1:
      this.$uniNavigateTo({
        url: '/pages/my/setUp/changePassword/changePassword'
      })
		  break;
		case 2:
      this.$uniNavigateTo({
        url: '/pages/my/setUp/aboutUs/aboutUs'
      })
		  break;
      }
    },
    /**
     * @name 退出登录
     */
    handleLoginOut(){
      uni.showModal({
        title: '提示',
        content: '是否退出登录？',
        success: (res)=>{
          if (res.confirm) {
            uni.removeStorageSync('user_info');
            setTimeout(()=> {
              uni.redirectTo({
                url: '/pages/login/registration'
              })
            }, 500)
          }
          if(res.cancel){
          }
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
